home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Original Shareware 1.1
/
The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso
/
16
/
anarkey2.zip
/
ANARKEY.DOC
< prev
next >
Wrap
Text File
|
1989-05-01
|
123KB
|
2,561 lines
ANARKEY
User Manual
Version 2.00
Anarchy : a state of being without rulers
Anarkey : a state of being without keystrokes
Steven Calwas
Moderne Software
P.O. Box 3638
Santa Clara, CA 95055-3638
_______
____|__ | (tm)
--| | |-------------------
| ____|__ | Association of
| | |_| Shareware
|__| o | Professionals
-----| | |---------------------
|___|___| MEMBER
Copyright (C) 1988, 1989
by Steven Calwas
All rights reserved
Introduction
------------
ANARKEY is a command-line editor that will significantly reduce the
number of keystrokes you make when entering DOS commands. Among its many
capabilities, ANARKEY supports:
o Command-line editing features comparable to those found in
expensive word processors
o Storage and retrieval of past command lines
o Two methods of command line retrieval:
1) sequential access
2) character matching where you enter a portion of the
line and have ANARKEY search through the buffer for a
matching completion
o A text substitution capability called an AKA (often referred to
as an "alias" or "synonym" in other command-line editors). A
utility program is included in the ANARKEY package that will
convert the alias and synonym definitions of other editors to the
equivalent ANARKEY format.
o Multiple commands per line
o A 255-character command line
o File name completion, including directory and program names
o Environment variable editing
o Configurable keystroke assignments
o Writing the command-line history buffer to a disk file
o Loading the history buffer and AKA definitions from disk files at
any time
o And much more!
ANARKEY is written 100% in assembly language for maximum efficiency in
memory usage and execution speed. When installed with the default 500-
character history buffer, ANARKEY requires less than 7400 bytes of memory.
A smaller buffer may be used, reducing memory usage even further.
ANARKEY is distributed as shareware. Each user is given the opportunity
to evaluate the complete ANARKEY software package for 30 days with no
obligation. If, after the evaluation period, you find ANARKEY to be a
useful tool, you must register your copy with the author, Steven Calwas.
ANARKEY registration is only $25 which includes a copy of the next
version when it becomes available. Considering the large number of times
you will be using ANARKEY during each computer session, this is an
outstanding value. Registered users of an earlier version may order the
next version for only $6.
An ANARKEY registration form is included in the distribution package in
the file ORDERFRM. Please take the time to fill it out and return it. If
you would like high-quality software to continue to be made available on a
try-first basis and for a reasonable cost, it is up to YOU to support such
programs. Please do.
A Quick Introduction
--------------------
This section will outline some of the powerful capabilities ANARKEY
provides. It should give you an idea of whether or not you wish to examine
ANARKEY in more depth. All of the functions presented here are discussed in
detail in subsequent sections of the manual.
ANARKEY is shipped in a default configuration, however, a very large
number of its characteristics are configurable to your specifications. Some
of the configurable characteristics are:
o ANARKEY keystrokes may be reconfigured by using ANARKED, the
ANARKEY Keystroke Editor.
o Powerup input mode can be set to either insert or overwrite.
o Cursor shape in each input mode can be set. (The cursor shape
can also remain unchanged if you so desire.)
o Command-line history buffer can hold from 255 to 50,000
characters.
o The length of the shortest line to store in the history buffer
can be set.
o Switch character conventions common to the UNIX operating system
(i.e. directories separated by a slash, '/', and options preceded
by a dash, '-') may be used. This feature works for "internal"
DOS commands, such as COPY and DIR, as well as "external"
commands, like XCOPY and LINK.
In addition to a high degree of malleability, ANARKEY brings to the DOS
command line many of the editing features available in expensive word
processors. For example, the cursor may be positioned anywhere on the
command line without destructively backspacing through characters. Also,
individual characters or entire words may be easily inserted or deleted
anywhere on the line.
Each command line you enter is stored by ANARKEY in a "history buffer."
These stored lines may be retrieved whenever you wish to execute them again.
The retrieved line may be edited before being executed or may be sent for
immediate execution upon retrieval. Never again will you retype a command
line.
ANARKEY provides two methods of line retrieval. The Up and Down
Arrow keys can be used to cycle sequentially through the history buffer and
retrieve one line at a time. When you get to the line you want, you may
then edit and execute it.
The second and more powerful retrieval method accepts one or more
characters of the desired line and then searches through the history buffer
until it finds a line starting with the same character(s). The matching
line is then entered on the command line. If the retrieved line is not the
desired line, the search may be continued and the next matching line
retrieved. This method of line completion is extremely powerful, especially
when the desired line is buried deep in the history buffer. Once you learn
how to use this capability, you'll wonder how you ever lived without it!
ANARKEY also supports the entering of multiple commands on a single input
line. This can be used to group a sequence of related commands together on
one line. For example, say you want to edit a letter and then print it.
Using DOS, this may require two lines: one to execute the word processor and
another to print the text file. With ANARKEY, both commands can be placed
on the same line.
To make it easy to fit more than one command on the line, ANARKEY will
accept input lines consisting of up to 255 characters.
ANARKEY provides a feature called an AKA (pronounced A-K-A) that allows
you to assign a single word to represent a long string of commands. Later,
when you enter the single word on the command line, ANARKEY will replace it
with the long line and execute it. For example, you may associate the
letter "D" to represent the string "DIR." Afterward, simply entering the
single character "D" on the command line will cause ANARKEY to execute the
associated string ("DIR").
An AKA may consist of multiple commands. Thus, by using an AKA, a single
character can execute several complicated commands. In this respect, an AKA
is much like a DOS batch file.
And, like a batch file, an AKA may contain parameters. AKA parameters
are specified by using the DOS batch conventions %1 through %9. As an
example, you may define the AKA "T" to represent the string "TYPE %1."
Subsequently, the command "T ANARKEY.DOC" will be expanded to "TYPE
ANARKEY.DOC." The advantage provided by an AKA over a batch file is that
the AKA will execute much more quickly than the equivalent batch file.
An AKA may be defined on the command line or read in from a disk file.
If you are already using a command-line editor that supports aliases or
synonyms, the CONVERT program is provided in the ANARKEY package to
translate your aliases and synonyms into an equivalent AKA format.
ANARKEY will also complete the names of files, programs and directories
for you. Simply type in zero(!) or more characters and ANARKEY will cycle
through all of the existing files with matching characters. This may seem
like a minor convenience, but, once you become used to it, you'll never
want to go back to entering an entire file specification again.
How often have you needed to add one more directory to your PATH
environment variable? Doing so in plain vanilla DOS is a pain because you
have to retype the entire PATH sequence. Not so with ANARKEY. ANARKEY will
retrieve the current PATH setting and enter it on the command line for you.
From there you may edit the line as you wish. This feature is not
restricted to the PATH variable either; ANARKEY will retrieve ANY
environment variable and allow you to modify it.
All of these features and much more are included in ANARKEY. If you
would like to learn how to use these capabilities and relieve yourself of
the drudgery of entering DOS commands then read on.
Getting Started
---------------
ANARKEY is ready to run "right out of the box." Simply enter its program
name on the DOS command line and ANARKEY will install itself. ANARKEY may
also be installed by running it from a batch file, such as AUTOEXEC.BAT.
ANARKEY is a TSR (Terminate-and-Stay-Resident) program. When executed
from the command line or from a batch file, it will install itself and then
return control to the DOS command prompt. During the installation process,
a short sign-on message will appear, such as:
C>ANARKEY
Anarkey 2.00
Copyright (C) 1988, 1989 by Steven Calwas. All rights reserved.
Establishing a 500-character history buffer.
C>_
Note:
If you are running ANARKEY for the first time and a message appears
stating the program is already installed, refer to the section "Installation
Options -- ANARKEY Process Number" for instructions on installing ANARKEY on
your machine.
Many of ANARKEY's features may be configured by specifying program
options at installation time. The supported options are described in the
"Installation Options" section later in this manual.
After installation, ANARKEY handles all input requests for the following
situations:
--the DOS command line
--redirected input
--DEBUG, SYMDEB, EDLIN and several third-party programs
Notice that commands executed from a batch file are NOT processed by
ANARKEY.
Many powerful features are available once ANARKEY is installed. They are
all described in the remainder of this manual.
Manual Organization
-------------------
The supported ANARKEY functions and related topics are grouped into the
following categories:
--Line Editing Functions
--History Buffer Functions
--AKA Functions
--File Name Completion Functions
--Entering Multiple Commands per Line
--Editing Environment Variables
--Installation Options
--ANARKEY Internals
--Special Considerations
--Future Directions
--The Spirit of ANARKEY
All of the supported functions are explained in detail within one of
these categories. In addition, a brief summary of all ANARKEY functions is
outlined in the file ANARKEY.SUM. You may find it helpful to keep a listing
of ANARKEY.SUM alongside your keyboard while you are learning the ANARKEY
commands.
Each documented ANARKEY function consists of two parts: a "function name"
and a "keystroke invocation." The function name is simply a descriptive tag
assigned to a function, just as a person's name is a kind of tag. The
keystroke invocation is the keystroke or keystrokes entered by the user
which cause the function to be executed.
The function definitions documented in this manual use the following
format:
<Keystroke Invocation> -- Function Name
The keystroke invocation is always contained within < > symbols. The < >
symbols are not part of the keystroke invocation and should not be entered
as such. Examples of some of the ANARKEY function definitions are:
<Home> -- Cursor to Start of Line
<F5> -- Find History Buffer Match and Edit
<Ctrl-K>
In the first example, the keystroke invocation for the Cursor-to-Start-
of-Line function is the <Home> key. In other words, pressing the <Home> key
will instruct ANARKEY to perform the Cursor-to-Start-of-Line function.
Some functions have two possible keystroke invocations, as in the second
example above. Entering either of the keystroke invocations will cause
ANARKEY to perform the indicated function. The example above shows that the
Find-History-Buffer-Match-and-Edit function may be executed by pressing
either the <F5> or <Ctrl-K> keys. Which invocation you decide to use
depends upon which keystroke you are most comfortable making.
Keystroke invocations are not case-sensitive. Thus, the keystrokes
<Ctrl-K> and <Ctrl-k> are equivalent.
Note: All keystroke invocations can be modified by ANARKED, the ANARKEY
Keystroke Editor. For instructions, refer to the "ANARKED User Manual."
Line Editing Functions
----------------------
ANARKEY provides line editing functions commonly found in word processing
programs. These functions include cursor movement, character deletion,
character retrieval and some general purpose features.
<Enter> -- Send Line to Command Processor
The input line is passed to ANARKEY for "acceptance." The cursor
need not be at the end of the line for the whole line to be
accepted; the entire command line is always accepted, regardless of
the cursor position.
The acceptance process includes "breaking" the line into separate
commands, checking that each command's length is within the
allowable range, and sending the commands individually to the
command processor. (This process is discussed in depth in the
"Entering Multiple Commands per Line" section.)
<Ins> -- Toggle Insert/Overwrite Mode
ANARKEY supports two modes of text input: insert mode and overwrite
mode. When editing in insert mode, characters entered will be
"inserted" into the current input line; any characters to the right
of the inserted character are shifted over to make room. Characters
entered in overwrite mode will "write over" the character under the
current cursor position; no shifting of characters occurs as in
insert mode.
The <Ins> key toggles the two input modes. By default, once the
mode has been set, ANARKEY remains in that mode until the <Ins> key
is pressed again. (The input mode can be forced to a particular
setting at the start of each new input line by using the 'F'
modifier to the -I installation option. Refer to the section
"Installation Options, Input Mode on Powerup" for further details.)
The default input mode upon program powerup is insert mode. If you
prefer ANARKEY to default to overwrite mode on powerup, use the -I
option (explained in "Installation Options, Input Mode on Powerup").
ANARKEY indicates the current input mode by setting the cursor
shape. An underscore cursor is used in the powerup mode; the
alternate mode uses a block cursor. The following table illustrates
the cursor shapes used depending upon the powerup mode.
Powerup mode = Insert (default and -II option)
Insert mode cursor = underscore
Overwrite mode cursor = block
Powerup mode = Overwrite (-IO option)
Insert mode cursor = block
Overwrite mode cursor = underscore
Cursor shape changes can be repressed by including the -C option on
the installation command line (see "Installation Options, Cursor
Shape Remains Unchanged").
<Ctrl-U> -- Accept Next Keystroke Unmodified
Enter the next keystroke into the input line, bypassing any ANARKEY
function interpretation.
Occasionally, you may wish to enter a keystroke on the input line
that would normally be interpreted by ANARKEY as a keystroke
invocation. For example, say you wanted to send a formfeed
character to your printer. One way to accomplish this might be to
enter a formfeed on the command line and then redirect the line to
the printer. The formfeed character is <Ctrl-L>. However, <Ctrl-L>
is normally interpreted by ANARKEY as an invocation of the Find-
History-Match-and-Execute function. To prevent ANARKEY from
interpreting the <Ctrl-L> as a keystroke invocation, precede it with
a <Ctrl-U>. Thus, the two keystroke sequence <Ctrl-U> <Ctrl-L> will
enter a <Ctrl-L> character on the input line.
This function may also be used to enter ANSI escape sequences on the
input line. Simply precede the <Esc> key with a <Ctrl-U> keystroke.
Being able to enter an <Esc> character on the input line will allow
you to create AKAs that assign string constants to the function
keys, define an elaborate command-line prompt, and set the screen
colors. Refer to the ANSI.SYS documentation that came with your
operating system or one of the public domain or shareware ANSI
device drivers for details on doing this.
Cursor movement functions allow the cursor to be positioned anywhere on
the input line. Once the cursor has been placed in its desired position,
further line modification operations, such as deleting or adding characters,
may be performed. The cursor movement functions provided by ANARKEY are
discussed below.
<Home> -- Cursor to Start of Line
Position the cursor under the first character in the input line.
<End> -- Cursor to End of Line
Position the cursor after the last character in the input line.
<Right Arrow> -- Cursor Right One Character
Move the cursor one character to the right.
<Ctrl-Right Arrow> -- Cursor Right One Word
Position the cursor under the start of the next word.
<Left Arrow> -- Cursor Left One Character
Move the cursor one character to the left.
<Ctrl-Left Arrow> -- Cursor Left One Word
Position the cursor under the start of the previous word.
Also provided are functions to delete individual or groups of characters
from the input line.
<Backspace> -- Delete Character Left
Move the cursor left one character and delete the character. If the
current input mode is insert mode, any characters from the current
cursor position to the end of the line are shifted one character to
the left. If the input mode is overwrite mode, no shift occurs.
<Del> -- Delete Current Character
Delete the character at the current cursor position. All characters
from the cursor position to the end of the line are shifted one
character to the left, regardless of the current input mode.
<Ctrl-T> -- Delete Word Right
Delete all characters from the current cursor position until the
start of the next word. All characters from the cursor position to
the end of the line are shifted to fill the space emptied by the
deleted word, regardless of the current input mode.
<Ctrl-End> -- Delete to End of Line
<Ctrl-Y>
Delete all characters from the current cursor position to the end of
the line.
<Esc> -- Delete Line
Clear the entire input line. Position the cursor at the "home"
position.
The CBL (current buffer line) pointer is moved to the end of the
history buffer. The CBL is discussed in detail in "History Buffer
Functions."
ANARKEY also supports two functions which are provided in the primitive
DOS list of editing functions: the retrieval of single characters from the
previous input line or the remainder of the previous line.
<F1> -- Retrieve Character From Previous Input Line
This function is identical to the DOS function associated with this
key.
A character is retrieved from the previous input line and entered
into the current line. The character retrieved is from the same
relative location as the current cursor position. The cursor
position is advanced to the next character location.
For example, if the cursor is at the third-character position in the
line when the <F1> key is hit, the third character from the previous
input line will be recalled and entered into the current line.
<F3> -- Retrieve Remainder of Previous Line and Edit
This function is identical to the DOS function associated with this
key.
The remainder of the previous input line is retrieved and entered
into the current line. The beginning of the retrieved portion is
from the same relative location as the current cursor position. The
cursor is positioned at the end of the current line. Editing may be
performed on the line.
<Alt-F3> -- Retrieve Remainder of Previous Line and Execute
This function is the same as the Retrieve-Remainder-...-and-Edit
function (<F3>) except that the line is immediately sent to the
command processor for execution. The user is given no opportunity
to edit the line.
Once you break the habit of leaning on the BackSpace key to correct any
typing errors and begin to use the ANARKEY editing functions to their
fullest, the blisters on your fingertips will clear up. And your keyboard
will thank you.
History Buffer Functions
------------------------
Introduction
------------
The history buffer functions provide ANARKEY with the very powerful
ability to quickly retrieve any previously-entered input line for either
editing or immediate execution.
Many work sequences done on a computer are repetitive. For example, a
programmer will edit a source file, compile it, link it and then execute it
checking for any bugs. If any problems are discovered, the whole cycle
begins again. Being able to quickly retrieve the commands entered during
the first pass through this cycle relieves the user of much annoying
busywork.
The History Buffer
------------------
ANARKEY stores all non-empty input lines in a "history buffer." Lines
consisting of multiple commands are placed in the buffer as a single intact
line. When ANARKEY is initially installed, the history buffer is empty.
The first input line entered by the user is stored by ANARKEY at the very
top of the history buffer. Subsequent input lines are stored, one after
another, toward the bottom of the buffer. This concept is depicted in the
following diagram which shows a history buffer completely filled with lines:
History Buffer
---------------------------- <--- Top of buffer
| rem This is line one |
| rem Followed by line two |
| rem Here's line three |
|/\/\/\/\/\/\/\/\/\/\/\/\/\|
.
.
.
|\/\/\/\/\/\/\/\/\/\/\/\/\/|
| rem Last line in buffer |
| |
---------------------------- <--- Bottom of buffer
Notice in the above diagram that there is an empty line at the bottom of
the buffer, even though the buffer is considered full. ANARKEY always
reserves an empty line at the bottom of the buffer which it uses as a marker
to signify the end of the buffer. This end-of-buffer, empty-line marker is
also useful to the user, as will become clear in the discussion on line
retrieval.
The contents of the history buffer may be viewed at any time.
<F4> -- Display History Buffer Contents
The input lines stored in the history buffer are displayed onscreen.
Lines are displayed beginning at the top of the buffer and advancing
to the end.
When an entire screen of lines has been displayed, output will
pause. Pressing any key will cause the next screenful of lines to
be displayed. ANARKEY supports screens consisting of ANY number of
lines and columns per screen, including 25, 43 and 50 lines.
Storing a new input line into a full history buffer is similar to how a
display screen handles the entering of an additional line. When a screen is
full, room is made at the bottom of the screen by scrolling the other lines
up. The line which used to be at the top of the screen disappears. The
same operation occurs when storing an input line into a full history buffer.
The line stored at the top of the buffer is permanently removed, all
remaining lines are shifted up and the new input line is entered at the
bottom of the buffer. The effects of storing an additional line in a full
history buffer are shown below:
rem This is line one <--- Removed from buffer
History Buffer
---------------------------- <--- Top of buffer
| rem Followed by line two |
| rem Here's line three |
|/\/\/\/\/\/\/\/\/\/\/\/\/\|
.
.
.
|\/\/\/\/\/\/\/\/\/\/\/\/\/|
| rem Last line in buffer |
| rem New last line |
| |
---------------------------- <--- Bottom of buffer
The number of input lines which can be stored in the history buffer
depends upon the length of the lines and the size of the buffer. By
default, the history buffer will hold 500 characters, but this may be
configured during installation from 255 to 50,000 characters. (Details are
contained in the "Installation Options, History Buffer Size" section.)
The Current Buffer Line or CBL
------------------------------
ANARKEY maintains a location marker which always "points" to the
beginning of one of the lines stored in the buffer. The line at which this
marker points is referred to as the "current buffer line" or CBL. Everytime
a new DOS command prompt appears, the CBL is reset to the end of the history
buffer, which, as mentioned above, will always be an empty line. Also,
invoking the Delete-Line function (<Esc> key) will move the CBL to the end
of the history buffer.
The following diagram depicts a history buffer with the CBL set to the
end of the buffer:
History Buffer
---------------------------- <--- Top of buffer
| rem Followed by line two |
| rem Here's line three |
|/\/\/\/\/\/\/\/\/\/\/\/\/\|
.
.
.
|\/\/\/\/\/\/\/\/\/\/\/\/\/|
| rem Last line in buffer |
| rem New last line |
CBL --->| |
---------------------------- <--- Bottom of buffer
Moving History Buffer Lines
---------------------------
During the course of entering command lines, many lines retrieved from
the history buffer will be executed without being edited. If these
re-executed and unedited lines were stored in the buffer each time, the
buffer would soon be cluttered with many copies of identical lines. Besides
creating an unnecessary mess, these duplicates would force other, less-often
executed, lines out of the buffer.
ANARKEY eliminates this problem. Any line retrieved from the history
buffer and "immediately accepted" is moved from its current location to the
end of the buffer. The phrase "immediately accepted" means that no editing
is performed on the line and the cursor is not moved. In other words, the
very next keystroke must accept the line (<Enter>).
By moving buffer lines, ANARKEY guarantees that heavily-executed lines
will always be available for retrieval and the history buffer will not
become cluttered with duplicate lines.
The moving of retrieved lines is the default operation that ANARKEY
performs. However, situations may arise where a log of each command in
their exact order of execution is desired. This can be achieved by
installing ANARKEY with the -F (full disclosure) option which represses the
moving of retrieved buffer lines. Refer to the "Installation Options, Full
Disclosure" section for more information about this option.
History Buffer Line Retrieval
-----------------------------
Moving the CBL pointer through the buffer is the method used to retrieve
stored input lines. ANARKEY provides two methods of retrieving input lines
from the history buffer: "bidirectional sequential access" and "character
matching."
Sequential Access Retrieval
---------------------------
With sequential access, the CBL is moved through the buffer one line at a
time. Each time the CBL is moved, the new line it points at in the buffer
is retrieved and displayed on the current input line, replacing any line
that was previously displayed. Sequential access is "bidirectional" because
the CBL pointer can be moved either up or down though the history buffer.
When the CBL points at the end of the buffer, moving down will cause the
CBL to circle around to point at the first line stored at the top of the
buffer. Conversely, with the CBL at the top of the buffer, moving up will
circle the CBL back to the end.
The following diagram shows the CBL moved up one line from its previous
location at the end of the buffer. When the CBL was moved, the line it now
points at would have been retrieved and displayed onscreen.
History Buffer
---------------------------- <--- Top of buffer
| rem Followed by line two |
| rem Here's line three |
|/\/\/\/\/\/\/\/\/\/\/\/\/\|
.
.
.
|\/\/\/\/\/\/\/\/\/\/\/\/\/|
| rem Last line in buffer |
CBL --->| rem New last line |
| |
---------------------------- <--- Bottom of buffer
Bidirectional sequential access is performed by invoking the following
ANARKEY functions:
<Up Arrow> -- Retrieve Previous History Buffer Line
Move the CBL pointer up one line. Retrieve the line and display it
onscreen, replacing any previously displayed line. Position the
cursor at the end of the displayed line.
If the very next keystroke accepts the line (<Enter>), the retrieved
line is moved from its current position in the history buffer to the
buffer's end. (Installing ANARKEY with the -F option will repress
this line movement.)
<Down Arrow> -- Retrieve Next History Buffer Line
Move the CBL pointer down one line. Retrieve the line and display
it onscreen, replacing any previously displayed line. Position the
cursor at the end of the displayed line.
If the very next keystroke accepts the line (<Enter>), the retrieved
line is moved from its current position in the history buffer to the
buffer's end. (Line movement can be repressed by installing ANARKEY
with the -F option.)
Character Matching Retrieval
----------------------------
The "character matching" method of line retrieval is one of the most
powerful features available in ANARKEY. With this method, a portion of a
past input line is entered and a search is made through the history buffer
for a line whose first characters match those just entered. If a match is
found, the line is retrieved from the buffer and entered onto the input
line.
Before performing the search operation, ANARKEY gathers together the
characters it will use for the comparison. It collects the characters
beginning at the start of the line up until the cursor position. The
character under the cursor (if there is one) is NOT included in the search.
The search begins in the history buffer at the CBL and continues up toward
the top of the buffer until either a match is found or the top of the buffer
is reached. The comparison performed upon the collected input line
characters and the retrieved buffer lines is not case-sensitive.
The exact operations executed during a search are:
1) The CBL pointer is moved up one line.
2) If moving the CBL pointer caused it to circle around to the
bottom of the history buffer, beep to signal that the CBL pointer
has traversed the entire buffer. Also, clear the displayed input
line from the cursor position to the end of the line. The search
operation is complete.
3) If the CBL pointer has not circled around, the CBL is retrieved
from the buffer, but is not displayed.
4) The character(s) collected from the current input line are
compared with the first character(s) in the retrieved line.
5) If the character(s) match, the remainder of the retrieved line is
displayed on the input line and the search operation is complete.
6) If the character(s) do not match, return to instruction (1) above
and repeat the cycle.
If a matching line is found, but it is not the line you desire, the
search may be continued and subsequent matching lines retrieved.
As explained in the list of search operations above, if a matching line
is found, it is entered onto the input line. When this occurs, the cursor
position is not changed. The reason for this is so that if the search is
continued, the same group of characters used in the original search, i.e.
those from the start of the line up until the cursor position, will be used
in the continuation.
The character matching method of line retrieval is one of the most useful
and powerful features of ANARKEY. Using it provides you with the ability to
enter only a single character and have ANARKEY complete the rest of the line
for you. After you are acquainted with this method, entering an entire
input line yourself will become drudgery.
To be certain everyone understands how to use the character matching
method, an extended example is provided below. But first, the ANARKEY
functions that implement the character matching retrieval method are:
<F5> -- Find History Buffer Match and Edit
<Ctrl-K>
Perform a character matching line retrieval operation. The
remainder of the matching retrieved line is displayed on the input
line, replacing any previously entered line. The line may be edited
before being accepted.
If the very next keystroke accepts the line (<Enter>), the retrieved
line is moved from its current position in the history buffer to the
buffer's end, unless ANARKEY was installed with the -F option.
<F6> -- Find History Buffer Match and Execute
<Ctrl-L>
This function is the same as the Find-Match-and-Edit function except
that the matching line is immediately sent to the command processor
for execution; the user is given no opportunity to edit the line.
Since the retrieved line is immediately executed, it is moved to the
end of the history buffer. (This movement is repressable by
installing ANARKEY with the -F option.)
If the top of the buffer is reached without finding a matching line,
the current input line is not sent to the command processor; further
editing of the line may be performed. The CBL will be set to the
end of the buffer.
An Extended Example
-------------------
As an example of the character matching functions, assume we are sitting
at a new line prompt (therefore, the CBL pointer references the empty line
at the end of the history buffer) and the buffer contains the following
lines:
History Buffer
------------------------------ <--- Top of buffer
| cd \work\jasper\memos\text |
| dir *.* |
| copy *.txt a: |
| dir a: |
CBL --->| |
------------------------------ <--- Bottom of buffer
Say we wish to move to the "\work\janice\memos\text" directory and copy
all files with a .TXT extension to the A: drive. Using the character
matching retrieval method, here is how we can do it.
First, we have to move to the desired directory. Since we have already
entered an input line similar to the one we now need (the CD line in the
buffer), let's retrieve and edit that line. Enter the first character of
the line we want, as in:
C>c_
The underscore shows the current cursor position. Then invoke the Find-
History-Buffer-Match-and-Edit function (<F5> or <Ctrl-K> key). ANARKEY
searches from the CBL up toward the top of the buffer for an input line
whose first character is a 'C.' It finds a matching line in the COPY
command. Thus, it retrieves that line from the buffer and displays it on
the input line. The current input line and history buffer are:
C>copy *.txt a:
-
History Buffer
------------------------------ <--- Top of buffer
| cd \work\jasper\memos\text |
| dir *.* |
CBL --->| copy *.txt a: |
| dir a: |
| |
------------------------------ <--- Bottom of buffer
Notice that the cursor position on the input line has not changed (it is
still immediately after the 'C'). Also, notice the CBL has been set to the
retrieved buffer line. Since this is not the line we want to execute,
continue the search by invoking the Find-Match-and-Edit function again (<F5>
or <Ctrl-K>). This time ANARKEY finds a match with the desired CD command.
That line is retrieved from the buffer and replaces the previously retrieved
COPY command. Now the input line and history buffer look like this:
C>cd \work\jasper\memos\text
-
History Buffer
------------------------------ <--- Top of buffer
CBL --->| cd \work\jasper\memos\text |
| dir *.* |
| copy *.txt a: |
| dir a: |
| |
------------------------------ <--- Bottom of buffer
The input line can now be edited using the available line-editing
functions. There are several different combinations of these functions which
can be used to perform this operation. One such combination is outlined
below.
User keystrokes Current input line and cursor position
--------------- --------------------------------------
C>cd \work\jasper\memos\text
-
<Ctrl-Right Arrow> C>cd \work\jasper\memos\text
-
<Ctrl-Right Arrow> C>cd \work\jasper\memos\text
-
<Right Arrow> <Right Arrow> C>cd \work\jasper\memos\text
-
<Ctrl-T> C>cd \work\ja\memos\text
-
nice C>cd \work\janice\memos\text
-
Note: The last line in the example assumes the input mode is set to
"insert."
The modified input line can now be accepted (<Enter> key) and executed.
Afterward, we will be in the \work\janice\memos\text directory and the
history buffer will look like this:
History Buffer
------------------------------ <--- Top of buffer
| cd \work\jasper\memos\text |
| dir *.* |
| copy *.txt a: |
| dir a: |
| cd \work\janice\memos\text |
CBL --->| |
------------------------------ <--- Bottom of buffer
Now we wish to copy all of the .TXT files to the A: drive. Since a line
already exists in the history buffer to perform this operation, there is no
need for us to type it on the command line; we'll let ANARKEY do it for us.
This time, we don't want to retrieve the CD command we just entered
before getting the desired COPY line, so we enter:
C>co_
And invoke the Find-History-Buffer-Match-and-Edit function (<F5> or
<Ctrl-K>). ANARKEY uses the characters from the start of the input line up
until the cursor (but not including the character under the cursor) in its
search for a matching line. In this case, ANARKEY uses the two characters
"co" to find a matching line. Subsequently, it retrieves the desired "copy"
command. Thus, when the search-and-retrieve operation is complete, the
input line and history buffer are:
C>copy *.txt a:
-
History Buffer
------------------------------ <--- Top of buffer
| cd \work\jasper\memos\text |
| dir *.* |
CBL --->| copy *.txt a: |
| dir a: |
| cd \work\janice\memos\text |
| |
------------------------------ <--- Bottom of buffer
Since this is the exact command we wish to execute, no editing is
required prior to acceptance. Following acceptance (<Enter>), the history
buffer will contain:
History Buffer
------------------------------ <--- Top of buffer
| cd \work\jasper\memos\text |
| dir *.* |
| dir a: |
| cd \work\janice\memos\text |
| copy *.txt a: |
CBL --->| |
------------------------------ <--- Bottom of buffer
Take a close look at the current history buffer. Notice that the
retrieved line has not only been entered at the bottom of the buffer, but
that it has been "moved" from its previous location between the two "dir"
commands. This occurred because the retrieved line was accepted unmodified.
Now we want a list of all the files we've copied to the A: drive. The
"dir a:" input line stored in the history buffer is exactly what we want.
Rather than type it ourselves, simply enter the single character 'D' so the
input line is:
C>d_
But this time invoke the Find-History-Buffer-Match-and-Execute function
(<F6> or <Ctrl-L>). ANARKEY will retrieve the first matching line in the
buffer (which just happens to be the "dir a:" command we desire) and
immediately pass it to the command processor for execution. This saves us
from entering the extra keystroke required (i.e. <Enter>) if we were to
accept the line ourselves. Once again, since the retrieved line was
immediately executed, it is moved to the end of the history buffer. Thus,
the history buffer at the end of our example would look this:
History Buffer
------------------------------ <--- Top of buffer
| cd \work\jasper\memos\text |
| dir *.* |
| cd \work\janice\memos\text |
| copy *.txt a: |
| dir a: |
CBL --->| |
------------------------------ <--- Bottom of buffer
The Find-Match-and-Execute function is powerful, but potentially
dangerous. In the above example, if a "del *.exe" command happened to be
stored in the history buffer between the "dir a:" command and the CBL, the
DEL command would have been retrieved and executed before anything could be
done about it. This may cause irreparable damage. To prevent this from
ever happening, you could always use the Find-Match-and-Edit function and
accept the line only after you've ascertained that the retrieved line is the
actual command(s) you wish to execute. On the other hand, for users who
"know what they are doing," the Find-Match-and-Execute function provides the
ability to reduce keystrokes even further and really soar.
Retrieving a Group of Lines
---------------------------
Often, a group of consecutive command lines need to be re-executed. For
instance, a programmer may edit a source file, compile and link it, test the
resulting program for bugs, and then begin the cycle again to correct any
problems. This cycle may result in a history buffer with the following
contents:
History Buffer
------------------------------ <--- Top of buffer
| edit file |
| compile file |
| link file |
| file |
CBL --->| |
------------------------------ <--- Bottom of buffer
It would be nice to be able to move the CBL pointer to the top of this
cycle and then have a simple method for retrieving each of the succeeding
lines. ANARKEY provides such a method.
<PgDn> -- Restore CBL
As previously described, when a new command prompt appears, the CBL
is initialized to point at the end of the history buffer. In
addition to this, the position of the CBL pointer at the time of
line acceptance is also saved. The CBL can be restored to this
saved position by invoking the Restore-CBL function (<PgDn>).
Given the above history buffer contents, assume the CBL was moved to
the top line. This can be done using either of the retrieval
methods. The situation would then be:
History Buffer
------------------------------ <--- Top of buffer
CBL --->| edit file |
| compile file |
| link file |
| file |
| |
------------------------------ <--- Bottom of buffer
If this line is then accepted (<Enter> key), several things would
occur. First, the retrieved line (assuming it was accepted
unmodified) would be moved to the end of the buffer. Second,
because the line was moved, the CBL would be the line AFTER the
retrieved line (i.e. the compile line). Third, as part of the
line-acceptance operation, the CBL position would be saved.
Following this, the retrieved line would be executed. When the
command prompt was next displayed, the CBL would be moved to the end
of the buffer (but the saved position would still be maintained).
This final state is depicted in the following diagram:
History Buffer
------------------------------ <--- Top of buffer
saved CBL --->| compile file |
| link file |
| file |
| edit file |
CBL --->| |
------------------------------ <--- Bottom of buffer
Now to retrieve the next line in the cycle, simply invoke the
Restore-CBL function (<PgDn> key). Doing so will move the CBL
pointer from its position at the end of the buffer to the saved
position. The history buffer would now look like this:
History Buffer
------------------------------ <--- Top of buffer
CBL --->| compile file |
| link file |
| file |
| edit file |
| |
------------------------------ <--- Bottom of buffer
The CBL would be retrieved from the buffer and displayed on the
input line. Accepting the line (<Enter>) will repeat the process.
All the lines in the cycle may be retrieved and executed this way.
The Restore-CBL function will work even if the move-line operation
is repressed (-F installation option) or the retrieved line is
edited prior to acceptance. ANARKEY is smart enough to know whether
or not the retrieved line has been moved and acts accordingly.
Restore-CBL can be executed once per command line. Subsequent
invocations will act as a Retrieve-Next-History-Buffer-Line function
(<Down Arrow>).
Miscellaneous History Buffer Functions
--------------------------------------
Additional functions allow you to write the contents of the buffer to a
disk file, remove lines from the buffer and clear the buffer.
<Ctrl-W> -- Write History Buffer to Disk
The history buffer contents are written to the ANARKEY.LOG disk
file. The file is located in the root directory of the current
drive. If the file cannot be written because the disk is full,
ANARKEY will beep.
ANARKEY.LOG is a standard ASCII text file which may be edited using
most editors and word processors. It may be reloaded into the
history buffer by LOAD, the ANARKEY Loader. Refer to the "LOAD User
Manual" for instructions on using LOAD.
<Ctrl-Z> -- Remove CBL from Buffer
If the CBL pointer is pointing at a non-empty line, i.e. the CBL
pointer is not at the end of the history buffer, the line pointed at
by the CBL pointer is removed from the buffer. All lines stored
after it in the buffer are shifted up. The result of this shift is
that the CBL pointer will then point at the line stored after the
removed line. This operation is depicted in the following two
diagrams. The first diagram shows the history buffer and CBL
pointer before removing the CBL.
History Buffer
| rem Line before removed line |
CBL --->| rem We'll remove this line |
| rem Line after removed line |
Here are the contents of the buffer and the position of the CBL
pointer after removing the CBL:
History Buffer
| rem Line before removed line |
CBL --->| rem Line after removed line |
| |
After the CBL has been removed and the buffer lines shifted, the new
CBL is displayed on the input line, replacing the previously
displayed line. The removal function may be repeated several times
to delete a group of consecutive lines from the buffer. If the last
non-empty line in the history buffer is removed, the CBL pointer
will be at the end of the buffer and an empty line will be displayed
on the input line.
<Ctrl-X> -- Clear History Buffer
Invoking this function will clear all lines from the history buffer.
Obviously, this function is potentially dangerous, so beware. If
you are afraid of accidentally invoking this function, use ANARKED,
the ANARKEY Keystroke Editor, to reassign its keystroke invocation
to something you are less likely to enter or remove its keystroke
invocation entirely, thereby making it impossible to execute.
ANARKED operation is explained in the "ANARKED User Manual."
The history buffer functions, and, in particular, the character matching
functions, give ANARKEY its main source of strength. Take the time to
become familiar and comfortable with them and chances are you will never
want to use your computer without them.
AKA Functions
-------------
Some commands are executed with great regularity. The history buffer
retrieval functions are extremely useful in reducing the number of times you
actually have to type in such lines. However, ANARKEY provides yet another
powerful feature called AKAs to ease the strain on your fingertips.
Simple Text Substitution
------------------------
An AKA (pronounced A-K-A) provides a text substitution capability to
ANARKEY. AKAs are analogous to aliases and synonyms found in other
command-line editors. AKA is an acronym for either "Also-Known-As" or
"AnarKey Alias." Once again, ANARKEY offers you a choice.
By default, AKAs are not an integral part of ANARKEY; they must be
enabled at installation time by the -A option (Allocate Space for AKA
Definitions). If AKAs are not enabled, none of the AKA-processing code
remains resident. This is an obvious advantage to users who do not use
AKAs; they do not have to pay a memory penalty for a feature they will never
exercise.
Refer to the section "Installation Options, Allocate Space for AKA
Definitions" for information on enabling the AKA features. The remainder of
this section will describe how to use AKAs once they are enabled.
An AKA is made up of two parts: an AKA word and a substitution string.
When the word is entered on the input line as a command, ANARKEY will
replace the AKA word with its substitution string. AKA words are not case
sensitive. As an example, an AKA could be:
dos cd \dos
--- -------
| |
AKA word <---- ----> Substitution string
If this was a "defined" AKA, meaning ANARKEY knew about it, then every
time "dos" was entered as a command on an input line, ANARKEY would replace
it with "cd \dos."
C>dos <---ANARKEY will replace with "cd \dos"
This replacement is performed after the line is accepted (<Enter>), but
before it is passed to the command processor for execution. Because the
replacement string is never displayed onscreen, the substitution operation
is transparent to the user. For example, the above AKA may result in the
following screen display:
>cd
C:\EDITOR\BACKUP
>dos <---replaced with "cd \dos"
>cd
C:\DOS
It is important to understand that the AKA word must be a "command" on
the input line. In other words, it must be the first word in the "command
line." (Because ANARKEY supports multiple commands per line, it must
differentiate between "command line" and "input line." There may be more
than one "command line" in the "input line." Multiple commands per line are
discussed in detail later in this manual.)
Again, given the above AKA, the following input line would not replace
"dos" with its substitution string:
>echo dos
In the example, "echo" is the command and "dos" is a "parameter" or
"argument" to the command. Since "dos" is not a command on this line, it
will not get replaced with its substitution string.
Viewing AKAs
------------
The list of defined AKAs may be viewed at any time by invoking the View-
AKAs function.
<Alt-F4> -- View AKAs
All defined AKAs are displayed onscreen. After a screen's worth of
AKAs have been displayed, output will pause. Pressing any key will
display another screen of AKA definitions.
At the end of the AKA list, ANARKEY will display the remaining space
available to store further AKA definitions.
When AKAs are not enabled (i.e. no space allocated for AKA
definitions via -A installation option), this keystroke invocation
has no effect.
Defining an AKA
---------------
An AKA must be "defined" before it can be used. ANARKEY provides two
methods to define AKAs. The definition may be entered on the input line or
it can be read from a disk file using LOAD, the ANARKEY Loader. The
definition syntax is identical for both methods. This section will present
examples of definitions as if they were entered on the command line. Refer
to the "LOAD User Manual" for instructions on how to read AKA definitions
from a disk file.
When defining an AKA, the very first character in the command must be a
colon. The characters following the colon, up until the first space or tab
character, comprise the AKA word. All remaining characters on the line make
up the substitution string.
Example AKA definitions are:
>:d dir
>:dos cd \dos
>:help type anarkey.sum
>:format echo You do not have access to this command!
AKA words and substitution strings can be of any length as long as their
total length does not exceed 255 characters. In other words, the AKA
definition must fit on the input line.
Any character may be used in an AKA word except a space or tab character,
since these characters indicate the end of the word. Control and graphic
characters are valid in an AKA word.
The amount of space allocated to store AKA definitions is specified at
ANARKEY installation time (-A option). (This option also enables AKAs and
keeps the AKA-processing code resident.) If there is not enough space left
to store a definition, ANARKEY will beep. When this occurs, there are
several roads you may choose. One choice would be to make room in the AKA
"buffer" by undefining one or more AKAs (undefining AKAs is explained
below). Another method is to retrieve the AKA definition from the history
buffer and edit it so that it will fit in the remaining AKA space (i.e. make
it shorter). If none of these routes is feasible, you can reboot your
system, but this time allocate more space for AKA definitions.
AKA substitution strings may contain multiple commands. Multiple
commands per line are discussed in detail a little later, but, basically,
each command must be separated by a semi-colon (;). Some example AKA
definitions consisting of multiple commands are:
>:edit cd\wordproc ; editor ; cd\homedir
>:editaka editor anarkey.aka;load anarkey.aka
In the first example, if you were to enter the command "edit," ANARKEY
would replace it with the substitution string which would execute the three
commands comprising it.
If an AKA definition is made that contains an AKA word already being
used, the new definition will replace the existing one. For example, given
the following AKA definitions, the second definition will replace the first:
>:d dir *.*
>:d del *.com
AKAs may not be nested. In other words, a substitution string may not
contain another AKA word. The following example shows an invalid AKA
definition:
>:r rem
>:ignore r
In the above example, "r" is first defined as an AKA word whose
substitution string is "rem." "R" is also specified as the replacement
string for "ignore." If "ignore" was entered as a command, ANARKEY would
replace it with its substitution string "r." It would not continue and
replace "r" with "rem."
When defining an AKA, ANARKEY performs a length check on each command in
the substitution string. If any command is longer than 127 characters,
ANARKEY will refuse to accept the definition. It will beep and place the
cursor under the first character beyond the 127-character limit. Further
editing of the command will be required before the definition can be
accepted.
A length check is always performed following input line acceptance
(<Enter> key). Length checks may optionally occur by invoking the Check-
Line-Lengths function (<F2>), documented in the "Multiple Commands Per Line"
section.
Undefining an AKA
-----------------
A single AKA may be undefined by entering a colon as the first character
in the command followed by the name of the AKA. Do not specify a
substitution string. When the line is accepted, the AKA will be undefined.
For example, the following commands undefine AKAs:
>:edit
>:d
ANARKEY also provides a way to undefine all existing AKAs in a single
swoop.
<Alt-X> -- Undefine All AKAs
Undefine all existing AKAs. All the allocated AKA space is freed
for new AKA definitions.
Parameter Fields
----------------
ANARKEY AKAs support more than just simple text substitution.
Substitution strings may contain "parameter" fields. These fields are
similar to the parameter fields in a DOS batch file. They are specified by
a leading percent sign (%) and followed by a single-digit number from 1 to
9, as in %1, %5 and %9. (%0 is not supported.)
When specified in an AKA substitution string, parameters fields are
replaced with the corresponding argument from the command line. For
example, %1 is replaced with the first argument to the AKA, %2 with the
second, and so on, up through %9.
>:example echo %1 %2 %3 %4 %5 %6 %7 %8 %9
>example one two three four five six seven eight nine
In this example, the %1 parameter in the AKA substitution string would be
replaced with the AKA argument "one," %2 with the second argument ("two")
and so on. The resulting line passed to the command processor would be:
echo one two three four five six seven eight nine
The resulting line may never exceed the maximum input line length of 255
characters. Also, each command in the line may not go beyond the requested
maximum length. In the case of the DOS command processor, this is 127
characters. If either of these events occur, ANARKEY will immediately stop
replacing parameter fields and pass the input line in its current form to
the command processer.
If the substitution string contains a parameter field, but the command
line does not include a corresponding argument, the parameter field is
simply removed from the expanded line. In other words, the parameter field
is replaced with nothing. This is depicted in the following AKA definition
and command:
>:pack echo %1%3%2
>pack a b <--- expands to "echo ab"
Notice that the %1 parameter was replaced with 'a,' 'b' is the second
argument so it replaces the %2 parameter, and, since there is no third
argument to replace the %3 parameter, it is "expanded" to nothing. The
resulting line passed to the command processor is "echo ab."
If there are more AKA arguments than there are parameter fields, the
extra arguments are ignored. As an example:
>:one-arg echo %1
>one-arg a b c <--- expands to "echo a"
The 'b' and 'c' arguments are not part of the resulting line.
If the AKA substitution string does not contain any parameter fields,
arguments on the command line are appended to the end of the replacement
string. For example:
>:d dir
>d *.com <--- expands to "dir *.com"
>:no-args dir;echo
>no-args *.com <--- expands to "dir;echo *.com"
Use of parameter fields in substitution strings can provide fast batch
files. This is due to the fact that the DOS command processor will accept
many of the commands normally executed in a batch file on the command line.
For example, you could enter "pause" on the command line and the result
would be the familiar "Hit any key to continue . . ." message. This ability
can be used to create very powerful and quick AKAs. As an example, consider
the following AKA definition:
:mcopy for %f in (%2 %3 %4 %5 %6 %7 %8 %9) do copy %1
This AKA will copy up to eight file specifications (the %2 through %9
parameter fields) to a destination (the %1 parameter field). For example:
>mcopy a: *.com *.exe *.doc anarkey.sum
Will expand into the commands:
copy *.com a:
copy *.exe a:
copy *.doc a:
copy anarkey.sum a:
All in one command!
File Name Completion Functions
------------------------------
As an additional feature to make the entering of commands as quick and
easy as possible, ANARKEY provides functions which will complete file names,
including directory and program names.
<F7> -- Complete Directory Name
<Ctrl-D>
When this function is invoked, ANARKEY extracts the characters
starting at the immediate left of the current cursor position and
proceeding left (toward the start of the line) until either a space
or the start of the line is reached. It uses these characters to
perform its search-and-compare operation, looking for an existing
directory with which to complete the name. The search-and-compare
operation is not case-sensitive.
If a match is found, it is inserted in the input line at the current
cursor position. After display, the cursor is moved to the end of
the completed name.
The matching directory is displayed in upper or lowercase depending
upon the current state of the CapsLock key. If CapsLock is active,
the directory is displayed in uppercase; if inactive, the name will
be in lowercase. Should no match be found, ANARKEY will respond
with a beep.
This function may be invoked repeatedly. Each successive invocation
will find any additional matching directory names. For example,
assume there are three directories that begin with the letter "M" in
the current directory. If you enter the character "M" and invoke
the Complete-Directory-Name function, ANARKEY will find one of the
directories and enter its name on the input line. If this is not
the directory you desire, invoking the function a second time will
cause another of the "M"-directories to replace the original match.
Another invocation will display the remaining matching directory.
Since there are no more matching directories, invoking the function
a fourth time will cause the last matched directory to be removed
from the input line and ANARKEY will beep. You may begin the cycle
all over again by invoking the function a fifth time, which would
once again display the first matching "M"-directory.
It is not necessary to enter any characters in order for ANARKEY to
perform a directory-completion operation. Simply invoke the
function with the cursor located at the start of the line or to the
right of at least one space, slash (/) or backslash (\) character
and ANARKEY will cycle through all the existing directory names.
Directories in locations other than the current directory or on a
drive other than the current drive may also be completed. To do so,
specify a path specification to the desired directory. Here is an
extended example:
Say you wish to enter the following command:
C>cd c:\dos\commands
Enter the following characters:
C>cd c:\_
The underscore represents the position of the cursor. Invoke the
Complete-Directory-Name function. ANARKEY will begin cycling
through all directories in the root of the C: drive. Eventually, it
will display the DOS directory. If you had added a "d" to the above
input line, ANARKEY would have cycled through all directories
starting with a "D"; add a "DO" and the cycle would be through
directories whose first two characters were "DO."
The current input line is now:
C>cd c:\dos_
The underscore represents the cursor position at the end of the
completed directory name. Add a backslash character.
C>cd c:\dos\_
This time, rather than cycle through all the directories, let's
retrieve only those directories whose first three characters are
"com" (there may be only one). Enter the three characters onto the
input line, like so:
C>cd c:\dos\com_
Invoke the Complete-Directory-Name function again. ANARKEY will
begin cycling through the directories whose first three characters
are "com" located in the DOS directory on the C: drive. Repeat
invoking the function as many times as is necessary until the
desired directory is displayed, in this case "commands."
C>cd c:\dos\commands_
And you've got it. This function can be especially useful when you
are working on a new machine whose directory structure you are
unfamiliar with.
NOTE:
Many people change the DOS switch character from a slash (/)
character to a dash (-) or something else. Doing so frees the slash
character to be used as a path separator in a directory
specification, as in:
C>cd c:/dos/commands
ANARKEY recognizes both backslashes (\) and slashes as path
separator characters in directory specifications.
<F8> -- Complete File or Program Name
<Ctrl-F>
The Complete-File-or-Program-Name function is similar to the
Complete-Directory-Name function. The main difference, as its name
implies, is that instead of completing directory names, the
Complete-File-or-Program-Name function completes program and file
names.
In ANARKEY, a "program" is defined as the first specification in a
command. A program specification may contain a drive and/or a
directory path. A program name must have a file extension of BAT,
COM or EXE. "Files" are all specifications which are passed to
programs in an argument list. In other words, all specifications in
a command other than the program name, are file names. File
specifications may also contain a drive and/or directory path and
may have any file extension.
All of the information presented in the Complete-Directory-Name
function is applicable to the Complete-File-or-Program-Name
function, including the non-case-sensitive search, the effect of the
CapsLock key, the repeatability of the function and the method of
character extraction upon which the search is performed. That
information will not be repeated here. Please refer to the
explanation of the Complete-Directory-Name function for background
information relevant to the Complete-File-or-Program-Name function.
This section will deal with those details which are specific to the
Complete-File-or-Program-Name function.
When the Complete-File-or-Program-Name function is invoked, ANARKEY
determines whether it is searching for a program or a file name
based upon the above definitions. Be aware of the fact that since
ANARKEY supports multiple commands per line (explained in the next
section), there may be multiple program names on a single input
line. ANARKEY will automatically determine whether it needs to
complete a program or a file name.
If a "program name" is being completed, ANARKEY will search the
appropriate directory for a matching file specification which has
the extension BAT, COM or EXE. If a match is found, the program name
is entered into the input line. The program's extension is not
displayed, just as you would not enter the extension were you to
type the program name yourself. Other possible situations are
handled in the same manner as in the Complete-Directory-Name
function.
If a "file name" completion is called for, all the files in the
appropriate directory are retrieved, one after another, in the same
cyclical operation as that used for directory and program names.
The complete file name, including extension, is entered onto the
input line.
In the case of file names, many files exist which are rarely entered
as arguments to programs. For example, files with the extensions
EXE, OBJ, and SYS are almost never part of a program's argument
list. Most of the time, a user would simply cycle past these file
names as they popped up during the completion operation. To save
the user from this unnecessary cycling, files with certain
extentions are ignored by ANARKEY when it is searching for a
matching file name. The ignored extensions are:
.$$$ .BAK .BIN .COM .EXE .HEX
.LIB .OBJ .OVR .SYS .TMP
Additional file extensions may be added to the ignored-extension
list during program installation (the -X option). Also, the
extensions listed above may be cleared so that ANARKEY will not
ignore file names with those extensions. Refer to the section
"Installation Options, Exclude File Extension" for details.
As a simple example, assume you are in a directory which contains a
single file called TEST.EXE. At the start of a new command, you
invoke the Complete-File-or-Program-Name function. ANARKEY would
find a program-name match with TEST.EXE and enter it on the input
line, like so:
C>test_
The cursor would be sitting immediately after the completed program
name. Add a space to the line.
C>test _
Invoking the Complete-File-or-Program-Name function now would get
only a beep as a response. This is because ANARKEY is now searching
for a file-name match and the only file it finds is TEST.EXE whose
.EXE extension is a member of the ignored-extension list. If you
truly wanted to include the file TEST.EXE in the program's argument
list, you would have to enter it yourself.
Alternatively, let's say you had installed ANARKEY so that it would
not use the default ignored-extension list. In that case, given the
above input line, ANARKEY WOULD match the TEST.EXE file. The input
line would then be:
C>test test.exe_
Of course, this example shows the most basic use of the Complete-
File-or-Program-Name function. Program and file names may include a
drive and/or path specifier, just as their directory-name
counterpart. When used in conjunction with the Complete-Directory-
Name function, entire commands can be entered with only a few
keystrokes.
Entering Multiple Commands per Line
-----------------------------------
The following ANARKEY functions are documented in this section:
<F2> -- Check Command Lengths
<F10> -- Repress Multiple Commands per Line
<Ctrl-R>
In DOS, the terms "line," "command" and "command line" all generally
refer to the same thing. This is because DOS supports only a single command
on each line. ANARKEY supports multiple commands per line and thus must
make a distinction between "commands" and "lines."
Support of multiple commands per line requires a method of specifying the
end of one command and the start of the next. ANARKEY interprets the
semicolon character (;) as just such a command separator. A semicolon must
lie between each of the commands on the input line. Spaces may be on either
side of the semicolon, but they are not required.
For example, to enter two commands on a single input line, enter the
first command, follow it with a semicolon, and then enter the next command.
This sequence may be followed for as many commands as will fit on the input
line. The number of commands allowed on a single input line is restricted
only by the input line's maximum length of 255 characters.
Some examples of input lines which contain multiple commands are:
C>dir a: ; pause ; del a:*.* ; copy *.* a: ; dir a:
C>cd \play;game;cd \work
C>edlin prog.c;cl -c prog.c
Some programs require that a semicolon occasionally be passed to them in
the program's argument list. There are three methods to include a semicolon
in a command:
1) Enter two consecutive semicolons on the input line.
2) Make the semicolon the very last character on the line.
3) Repress semicolon/command separator interpretation for the line.
Note: Many environment varibles use semicolons as part of their value.
The PATH variable is one example. Rather than require the entering of
consecutive semicolons, ANARKEY will not translate semicolons when they are
contained within a SET, PATH or PROMPT command. This topic is discussed in
detail in the "Editing Environment Variables" section.
As an example, the LINK program interprets a semicolon character as
designating the end of the argument list. Some valid input lines which
invoke the LINK program are:
C>link prog;
C>link prog;;
C>link prog;;;exe2bin prog prog.com ; del prog.exe
In the first example, the semicolon is the last character on the input
line, therefore it is passed as part of the command.
The second example shows a situation where the first semicolon is not at
the end of the input line, but it is followed immediately by another
semicolon. In this case, the consecutive semicolons are converted to a
single semicolon character and passed to the command processor.
Notice that the first two examples result in identical commands. They
are shown to illustrate the fact that, although it is not always necessary,
if you consistently enter consecutive semicolons whenever it is desired to
pass a semicolon as part of a command, you will never get burned.
The third example above displays how semicolons may be used as both
command separators and part of a command. The first two semicolons are
converted to a single semicolon and entered as part of the LINK command. The
third and fourth semicolons are interpreted as command separators. The
third example will be dissected into the following three commands (the
quotation marks are included only to illustrate the blank characters in each
command; they are not actually part of the commands):
"link prog;"
"exe2bin prog prog.com "
" del prog.exe"
Be aware that semicolons used to separate commands may have blank
characters before and/or after them. However, to pass a semicolon as part
of a command, the semicolons must be consecutive with no space between them.
Thus, the above example may have been entered as:
C>link prog;; ; exe2bin ...
But not as:
C>link prog; ; ; exe2bin ...
Another method to disable semicolon interpretation is to invoke the
Repress-Multiple-Commands-per-Line function. Pressing the <F10> or <Ctrl-R>
key will repress semicolon interpretation for the current input line. The
entire line will be passed to the command processor unmodified. This
function performs a temporary repression for the current input line only;
the next input line will support semicolon translation unless this function
is invoked again.
With ANARKEY installed, input lines may be up to 255 characters in
length. Each input line may contain several commands. Individual commands
consist of no more than 127 characters.
This 127-character limit is imposed by the DOS command processor,
COMMAND.COM. If you are using some other command processor, the length
limit may differ. ANARKEY enforces and supports the length limit of all
third-party command processors, provided the command processor uses the same
method of line input that COMMAND.COM uses.
ANARKEY will not let you enter an input line that exceeds 255 characters,
nor will commands which go beyond their length limit (usually 127
characters) be accepted. Should you attempt to enter more than 255
characters on an input line, ANARKEY will beep and refuse to accept the
input. Commands that exceed 127 characters are caught by ANARKEY after you
accept the input line (by hitting the <Enter> key).
After pressing <Enter>, ANARKEY "breaks" the line into individual
commands based upon any translated semicolons. It then checks to verify
that each command does not exceed the 127-character command-length limit.
If a command is found which exceeds the limit, ANARKEY will beep and
position the cursor under the first character beyond the allowable limit.
The character under the cursor and all subsequent characters in that command
go beyond the boundary. In order to get ANARKEY to accept the command, you
must edit it so that it fits within the allowable length.
In addition to this automatic length-check, you may have ANARKEY perform
a check at any time during line entry. Simply invoke the Check-Command-
Length function by pressing the <F2> key. This function performs the
command length check without passing the input line to ANARKEY for
acceptance. If all commands are within the allowable range, nothing will
happen. However, if a command is found which exceeds the boundary, ANARKEY
will beep and the cursor will be positioned under the first out-of-bounds
character. This interactive length-check may be useful when you're trying
to squeeze one more file name in a command or an additional directory
specification in a PATH variable and you're not sure whether you've gone
past the limit.
If all commands are within the allowable boundary, each is passed to the
command processor one at a time, as if they had each been entered on their
own input line. When the command processor is finished executing a command
and requests another, ANARKEY will pass it the next command extracted from
the input line. This cycle continues until all the commands on the input
line are passed to the command processor. Notice that no multitasking
(simultaneous execution of multiple programs) occurs when entering multiple
commands on a line. No command begins execution until the command preceding
it has completed.
Note: LOAD, the ANARKEY Loader, may be executed from a multiple-command
line, however, it must be the LAST command in the line. Any commands
following LOAD will not be executed.
Multiple commands per line can be very useful in instances where the
creation of a batch file is unwarranted. Sometimes a group of commands
needs to be executed, however, their execution is a one-time occurrence so a
batch file is not really necessary. Such a situation may be the copying of
a group of files, as in:
C>copy *.c \c\source;copy *.h \c\include;copy *.obj \c\objects
In this example, rather than entering each command on their own input
line and waiting for each to complete so you can enter the next one, you can
enter them all at once and go get coffee while they're executing.
Another use of multiple-commands which may not be obvious is for
documentation purposes. A REM statement could be added to the input line
explaining the reason for the commands on the line. For example:
C>edlin corpx.txt ; rem Incorporate 12/14 proposal changes
C>edlin prog.c ; make ; rem Enable debug statements
If this is done on a regular basis, the exact sequence of events in any
daily operation can be documented by displaying the contents of the history
buffer (<F4>) or writing the buffer to a disk file (<Ctrl-W>). (See the
documentation explaining the Full Disclosure (-F) installation option for
more information on this technique.)
Multiple-Command Lines and Secondary Shells
-------------------------------------------
Multiple-command lines create one problematic situation, demonstrated in
the following input line:
C>cd \text ; editor letter.doc ; cd \home
Such a sequence of commands might be executed to temporarily move to a
working subdirectory, perform an operation (in this case, edit a file) and
then return to the starting directory. Most modern editors and word
processors provide the capability to temporarily exit to a DOS command
prompt, execute one or more commands and then return to the original
program, picking up where it had left off.
During such an operation, the exit to the DOS command prompt will result
in the command processor making a request for input. Under normal
conditions, ANARKEY would return the next command in the multiple-command
line. However, in this case, doing so would not be the desired response;
the next command should not be executed until the preceding command has
completed. Thus, ANARKEY must handle this situation in a special manner.
ANARKEY will automatically recognize the above-described condition. When
it does, ANARKEY will not handle the request for input itself. Instead, the
original DOS input handler is called to process the input request. During
this time, none of the ANARKEY functions will be available. Only after
exiting the secondary command processor, completing the original program and
returning to the original command prompt, will ANARKEY reactivate itself and
return the next command in the multiple-command line.
All of this may seem a bit confusing and difficult to remember, however,
be aware that such situations will rarely occur and, when they do, ANARKEY
will handle them for you automatically.
Editing Environment Variables
-----------------------------
It is often necessary to view the current value of a single environment
variable or to modify a variable's setting. ANARKEY provides the capability
to recall and edit the value of any defined environment variable. This is
especially handy when you have a long PATH setting and wish to add a single
directory to it. DOS would require that you reenter the entire list of
directories. ANARKEY will retrieve the current PATH value and allow you to
edit it as you wish.
<F9> -- Retrieve Environment Variable
<Ctrl-E>
To retrieve the current value of an environment variable, enter the DOS
SET command followed by the complete name of the variable. Variable names
may be entered in upper or lowercase. An equal sign may or may not follow
the environment variable name. If an equal sign is not entered after the
variable name, ANARKEY will automatically enter it for you.
As an example, if you wish to retrieve the current value of the COMSPEC
environment variable, enter:
C>set comspec_
The underscore designates the location of the cursor. When retrieving
environment variable values, the cursor should always reside immediately
after the last character of the variable's name. Be aware that spaces are
allowed in environment variable names, therefore the names "COMSPEC" and
"COMSPEC " may exist simultaneously as two separate variables. (DOS will
allow any character as part of an environment variable name except the
characters <, >, | and =. ANARKEY adds the further restriction that they
may not contain a semicolon (;) character, either.)
After entering the variable's complete name, invoke the Retrieve-
Environment-Variable function by pressing either <F9> or <Ctrl-E>. ANARKEY
will insert an equal sign at the current cursor position. If the specified
environment variable exists, its current value is displayed beginning
immediately after the equal sign. If there is no such variable, no value is
displayed. In either case, the cursor is positioned at the first character
after the inserted equal sign.
Given the example presented above, invocation of the Retrieve-
Environment-Variable function might result in the following display:
C>set comspec=C:\DOS\COMMAND.COM
-
The cursor would be positioned under the C drive specification,
immediately following the equal sign. Any part of the line may now be
modified using the available editing functions.
The Retrieve-Environment-Variable function may be used to recall variable
values simply to see to what value a specific variable is currently set.
This ability is most useful when a large number of environment variables
exist on a system and recalling all variables (as with a simple "SET"
command) would cause the variable list to scroll offscreen. This situation
is becoming increasingly common as more and more programs require the
definition of multiple environment variables, usually for program
configuration purposes.
Also, as previously suggested, environment variable retrieval is
extremely useful when you wish to edit a very long variable value, as is
often the case with the PATH variable.
And speaking of PATH, DOS handles the PATH variable in a manner which is
slightly different from other environment variables. PATH is special in
that it does not require the SET command to precede it on the input line.
SET may be used, but is not required as it is for other variables. ANARKEY
supports this special handling of the PATH variable; it will retrieve the
current PATH value given either of the following input lines:
C>set path_
C>path_
PROMPT is another environment variable that does not need to be prefaced
by the SET command. ANARKEY handles PROMPT in exactly the same manner it
does PATH.
Even though the examples show situations where the SET, PATH or PROMPT
command is the first and only command on the input line, this is not a
restriction of the Retrieve-Environment-Variable function. The function may
be invoked upon any command on the input line, as in:
C>dir *.* ; set comspec_
Use of the semicolon (;) character in environment variables AND as a
command separator presents a special problem. For example, PATH and other
environment values commonly specify several directories, each separated by a
semicolon. Normally, ANARKEY would interpret these single semicolons as
command separators. To include an actual semicolon in the value would
require either two consecutive semicolons or the repression of multiple
commands (as explained in the "Entering Multiple Commands per Line"
section). If this were the final situation, it would be particularly
annoying, at best. Fortunately, ANARKEY makes provisions for this
condition.
Since SET, PATH and, to a lesser extent, PROMPT commands are fairly
common, ANARKEY treats them as special cases. While ANARKEY is breaking the
input line into individual commands, it checks each command to see if it is
SET, PATH or PROMPT. If it is, semicolon/command separator translation is
immediately turned off for the remainder of the line. All remaining
semicolon characters on the line are interpreted as straight semicolons.
Two consecutive semicolons are interpreted as two consecutive semicolons;
they are not translated to a single semicolon as they normally would with
translation.
The consequence of this solution is that another command may not follow a
SET, PATH or PROMPT command on the same input line. Since the semicolon
translation is turned off, there is no way of indicating the end of the
SET/PATH/PROMPT other than the end of the input line. Other commands may
still precede a SET, PATH or PROMPT command.
Other than the uses already mentioned, this function may also be used to
save a variable's current setting, temporarily modify it and eventually
restore the saved value. For example, say you want a different PATH value
for a short period of time. Either of the following sequences would save
you time:
1) Recall the current PATH value.
2) Using the editing functions, change the name of the PATH variable
to SAVED PATH. (Remember that spaces are valid characters within
environment variable names.) Be sure to precede "SAVED PATH"
with a SET command; only PATH does not require it. After you've
hit <Enter>, you'll have two environment variables, PATH and
SAVED PATH.
3) Set the new PATH value. (If the new value resembles the original
value, you may want to retrieve the original value and edit it.)
4) Execute the desired commands which will use the new PATH value.
5) To restore the original PATH, retrieve the SAVED PATH variable
(you'll need to use SET). Rename the variable from SAVED PATH to
PATH (you can delete the SET command, too).
Alternatively:
1) Recall the current PATH value.
2) Without making any modifications, accept the line by pressing
<Enter>. This will store the input line in the history buffer.
3) Create your modified PATH value.
4) Execute the commands which use the new value.
5) Retrieve the input line previously stored in (2) by using the
supported history buffer functions. Acceptance of the retrieved
line will restore the original variable value.
The second method described above has the advantage of not requiring an
additional environment variable. However, you may come across situations
where the first method is a more desirable solution.
Keep this function in mind whenever environment variables are concerned
and further uses, often in conjunction with the other ANARKEY functions,
will make themselves known.
Installation Options
--------------------
ANARKEY supports an assortment of configuration options which may be
specified during program installation.
An option may be in upper or lowercase and each must be preceded by a
dash (-) or slash (/) character. All options are single characters, however,
some options require an additional argument which must appear immediately
after the option. Options may appear in any order and each must be
separated by at least one space.
An example ANARKEY installation line is:
C>anarkey -f -b1000 -io
The supported ANARKEY options are detailed in the remainder of this
section.
The notational conventions used are:
n -- represents a numeric argument
x -- represents an alphanumeric argument
[] -- an argument in brackets represents an optional argument
-An -- Allocate Space for AKA Definitions
By default, AKAs are not supported by ANARKEY. They must be enabled
by the -A installation option.
This option specifies how much space to reserve for AKA definitions.
The amount of space is specified in number of characters.
The total amount of space allocated for AKA storage and the history
buffer (-H option) may not exceed 50,000 characters. ANARKEY will
automatically adjust the space allocated for AKA definitions if this
limit is exceeded.
To allocate enough space to store 400 characters of AKA definitions:
C>anarkey -a400
-C -- Cursor Shape Remains Unchanged
Normally, ANARKEY sets the cursor shape based upon the input mode.
Use of this option will repress all changes of the cursor shape.
-F -- Full Disclosure
Under default operation, when a line is retrieved from the history
buffer and then immediately accepted, ANARKEY moves the line to the
end of the buffer. Doing so prevents the buffer from becoming
cluttered with duplicate lines.
The -F option will repress this line movement and maintain the
history buffer as a log of each line in their executed order.
-Hn -- History Buffer Size
Create a history buffer capable of holding *n* number of characters.
Buffer size may range from 255 to 50,000. Default buffer size is
500 characters. If you try to set a buffer size less than 255 or
greater than 50,000, ANARKEY will use the default value of 500.
If AKA storage space is allocated (-A option), the total space used
by the history buffer and AKA storage together may not exceed
50,000. ANARKEY will automatically adjust the space allocated for
AKA definitions if this limit is exceeded.
To allocate a history buffer of 10,000 characters:
C>anarkey -h10000
Notice that commas should not be included as part of the size value.
-Ix[F] -- Input Mode on Powerup [and Start of Input Line]
Set the initial input mode to insert(x = I) or overwrite(x = O)
mode. The default value of x is I (insert mode).
The powerup input mode affects the cursor shape. An underscore
cursor is used in the powerup mode; the alternate mode uses a
block-shaped cursor. (Note: Changing cursor shapes can be repressed
by using the -C option.)
To start ANARKEY in overwrite mode:
C>anarkey -io
During normal operation, ANARKEY will not change the input mode
until you explicitly tell it to do so by invoking the
Toggle-Insert/Overwrite-Mode function (<Ins>).
Alternatively, ANARKEY may be configured to force the input mode
back to the powerup setting at the start of each new input line.
(Many of the alternative command-line editors operate this way by
default.) Simply append the 'F' option-modifier to the end of the
-I option and ANARKEY will automatically force the input mode to the
powerup setting whenever a new input line is requested.
To start ANARKEY in overwrite mode and force the input mode to
overwrite at the beginning of each new line:
C>anarkey -iof
To start ANARKEY in insert mode and force it into that mode at the
start of each line:
C>anarkey -iif
-M -- Display ANARKEY Memory Usage
The increasing size of application programs and DOS's limitation of
640K of program memory have combined to make users count every byte
their TSR programs eat up. ANARKEY will tell you exactly how much
memory it will request from DOS when the -M option is included on
the installation command line.
Add the -M option to any valid installation line and ANARKEY will
calculate and display how much memory the specified configuration
will require. ANARKEY will not install itself; this option is for
informational purposes only.
To find out how much memory ANARKEY will request when configured
with a 1000-character history buffer and 400 characters allocated
for AKAs:
C>anarkey -a400 -h1000 -m
Note:
The memory usage displayed by the -M option is not the exact
amount DOS will reserve for ANARKEY; it is the amount ANARKEY will
ask DOS to reserve for it. DOS only guarantees that it will reserve
AT LEAST the amount of memory requested. To the requested value
will be added the space allocated for defined environment variables.
Tip:
When a program is executed, it is assigned a copy of all defined
environment variables at the time of execution. If that program
remains resident, this environment space remains resident with it.
You can reduce the amount of memory a resident program requires by
installing it BEFORE defining all your environment variables.
-Pn -- ANARKEY Process Number
When ANARKEY is run under DOS version 3.1 and later, it assigns
to itself a process number which it later uses to determine if it
is already installed. There exists a small possibility that another
TSR program will use the same process number ANARKEY wishes to use.
If this is the case, ANARKEY will think it has already been
installed when, in fact, it has not been. To install ANARKEY in
this situation, ANARKEY must use an alternative process number which
is specified via this option.
The default process number is 35. Valid process numbers are 0 to
63.
Here is an example of a ANARKEY installation that uses an
alternative process number of 14:
C>anarkey -p14
If ANARKEY refuses to install, continue trying all valid process
numbers. (It will be extremely rare situations where this option
will need to be used at all, let alone attempted several times.)
This option is ignored under DOS versions earlier than 3.1.
-Q -- Run ANARKEY in Quiet Mode
In quiet mode, the bell will sound only in situations where no other
form of error notification is provided. For example, it will not
sound after cycling through all filename or history buffer
completions and no matches remain. However, the bell will still
ring if an AKA definition cannot be stored due to lack of storage
space.
-Sn -- Shortest Line to Store in History Buffer
Short input lines are often easier to retype than to retrieve from
the history buffer. Rather than have these short lines clutter the
buffer, they can be excluded from ever being entered.
The -S option specifies the shortest line length required for a line
to be stored in the history buffer. Lines of less length will not
be entered.
By default, ANARKEY stores all non-empty lines (-S1). Empty lines
are never stored in the history buffer, even if -S0 is specified.
To store only lines of four or more characters:
C>anarkey -s4
-U[S] -- Translate Characters to UNIX Standards
Many people prefer the DOS switch character, which is the slash(/)
character by default, to be changed to conform to the UNIX operating
system's standard of a dash(-). Changing the switch character
allows the slash to be used as a directory separator in a path
specification, as in "C:/DOS/PROGS." Dashes are used in situations
where slashes used to be, for example, "DIR -W."
DOS has an undocumented operating system function that will allow
the alteration of the DOS switch character. Many public domain
programs exist that will use this undocumented function to change
the switch character. These programs are especially popular among
people who alternate their time between DOS and UNIX systems.
Unfortunately, the DOS function has a few peculiarities which make
it a bit unstable. Even worse, though, is the fact that the DOS 3.x
compatibility box in OS/2 does not support the undocumented
function at all, making it impossible to change the switch
character. The -U option is meant to solve these problems.
When -U is specified on the installation command line, ANARKEY will
perform character translations on all slash(/) and dash(-)
characters contained in each accepted input line. All slash
characters are translated to backslashes(\) and dashes are changed
to slashes(/). This allows the UNIX-standard usage of the switch
character and directory separator.
For example,
>DIR/ is translated to >DIR\
>CD /DOS/PROGS is translated to >CD \DOS\PROGS
>DIR /DOS -P is translated to >DIR \DOS /P
>XCOPY /*.* -S is translated to >XCOPY \*.* /S
To enter an actual slash or dash on the input line, enter two
consecutive characters. For example,
>DIR PROG--1.* is translated to >DIR PROG-1.*
>LINK PROG //NOI; is translated to >LINK PROG /NOI;
>LINK PROG -NOI; is translated to >LINK PROG /NOI;
The S modifier may optionally be appended to the -U option (i.e.
-US). This will cause only slash characters to be translated;
dashes will remain unchanged. This is most useful if you run many
programs that will accept only the dash character as a switch
specifier.
An example will best demonstrate this situation. Say you use a DOS
version of the UNIX LS command that will only accept a dash
preceding each option. To preserve the dash with ANARKEY installed
with the -U option (i.e. to keep the dash from being translated to a
slash), it would be necessary to enter consecutive dashes for each
program invocation, as in:
ls --l *.exe
This is probably inconvenient. Installing ANARKEY with -US will
repress the translation of the dash and make the consecutive dashes
unnecessary. Unfortunately, -US has its own quirk; whenever you
wish to enter a slash, you MUST enter consecutive slashes. For
example,
copy *.exe a: //v
Due to these quirks, neither of these options is entirely
satisfactory. They are provided for those users who desire the
convenience of using the slash character in path specifications and
are willing to put up with the resulting oddities. Depending on the
characteristics of the programs you run, -U or -US will be more
appropriate.
UNIX-standard character translation occurs after any AKA
substitution.
Note: This option has one disadvantage over the undocumented
function call: since ANARKEY is not active when processing batch
files, it cannot perform the character translation in commands
executed from a batch file. For this reason, it may be more
desirable to continue to use the undocumented function when running
under DOS. However, as mentioned, the OS/2 DOS 3.x compatibility
box provides no support for changing the switch character. When
running in this environment, the -U[S] option is the only way to go.
-Xxxx -- Exclude File Extension
Add a file extension to the ignored-extensions list used during a
filename-completion operation.
During filename completion, ANARKEY automatically ignores all files
with the following extensions:
.$$$ .BAK .BIN .COM .EXE .HEX
.LIB .OBJ .OVR .SYS .TMP
To include additional extensions in this list, specify them using
the -X option. An installation configuration may contain up to six
-X options. Standard DOS wildcard characters '?' and '*' are
supported.
Example:
C>anarkey -xtxt -xbat -xq* -x??v
The above line would cause ANARKEY to ignore all files with a .TXT
or .BAT extension and any extension that started with a 'Q' or ended
with a 'V'.
-X\ is a special case option that will clear the entire extension
list. Use -X\ if you do not wish to use the default extensions
listed above. -X\ should be specified prior to any other -X options
so as to prevent clearing any extensions you've added to the list.
-X\ does not count toward one of the possible six -X options.
ANARKEY Internals
-----------------
This section documents some of the inner workings of the ANARKEY program.
It is not necessary to read and understand this section in order to use
ANARKEY. The information is provided for those people who prefer to know
something about the internal operations of the programs which they run.
Those people with no interest in this area may safely skip this section and
proceed to the next.
The following discussion assumes the reader has a general understanding
of DOS functions and TSR program structure.
Upon installation, ANARKEY hooks into two interrupts:
1) Interrupt used to install program signature
-DOS versions before 3.1 use one interrupt between 60h-67h
-DOS 3.1 and later use interrupt 2Fh
2) Interrupt 21h, function 0Ah
Upon initial program execution, a program "signature" is installed which
is used by ANARKEY to prevent itself from being installed more than once.
Depending upon the DOS version, a different method of signature installation
is performed.
Under DOS 2.x thru 3.0, ANARKEY scans interrupt vectors 60h thru 67h
searching for an unused vector (signified by a null value). If an unused
vector is found, ANARKEY takes it and installs its program signature there.
If all the vectors are in use, ANARKEY does not install a program signature.
In the latter case, it will be possible to reinstall ANARKEY again,
although doing so is not recommended. (A reinstalled ANARKEY will not hang
your system, however, you will lose both the contents of your current
history buffer and the memory used by the originally-installed program.) If
ANARKEY cannot install its signature, it will display a message stating as
much and continue execution. This message should be considered a warning
that the automatic installation mechanism built-in to ANARKEY will not be
able to save you should you inadvertently reinstall it.
Running DOS 3.1 and later, ANARKEY chains into interrupt 2Fh. This is
the multiplex interrupt and is shared between the PRINT, SHARE and other TSR
programs. Programs chaining into this interrupt assign themselves a
"process number" which is used for identification purposes. Process numbers
0C0h thru 0FFh are reserved for user programs. By default, ANARKEY
appropriates process number 0E3h. Upon program initialization, ANARKEY
queries the appropriate process number to check if it has already been
installed.
If this process number is being used by another TSR program, ANARKEY will
believe that it has already been installed. It will display a message
stating as much and refuse to continue execution. If this is the case, the
installation option -P may be used to install ANARKEY under a different
process number. (The -P option is documented in the "Installation Options,
ANARKEY Process Number" section. Notice that the -P argument which
specifies the new process number has been "de-programmer-ized." Process
numbers are specified in decimal and range from 0 to 63. The
de-programmer-ized value is first added to 0C0h (re-programmer-ized?) before
being used for installation.)
Once ANARKEY has verified that it is not already installed, it hooks into
interrupt 21h, function 0Ah, the buffered input routine. The resident
portion of ANARKEY is a replacement for this function, the standard version
of which is provided by the operating system.
After installing its signature and hooking into the buffered input
interrupt, ANARKEY terminates its execution, but remains resident in system
memory. Most subsequent calls for buffered input will be handled by
ANARKEY.
Special Considerations
----------------------
A few situations exist in which ANARKEY must operate in a special manner.
Each of these special and rare circumstances are described in this section.
Redirecting Output to a Serial Terminal
---------------------------------------
When output is redirected to a serial terminal, i.e. the COM device, a
special set of problems arises. Due to the many different characteristics
of serial terminal displays, it is difficult to implement many of the
ANARKEY functions so that they are compatible with all available terminals.
Because output redirection to a COM device is a relatively rare occurence,
ANARKEY handles this situation in a special manner.
When output is redirected to a COM device, either by using the
redirection character ('>') or executing the CTTY program, ANARKEY will
temporarily disable itself. ANARKEY will remain disabled until output is no
longer redirected to the COM device, at which time it will re-enable itself.
Notice that ANARKEY will recognize this situation on its own and will handle
it appropriately; there is no need for the user to do anything special.
Incompatible Programs
---------------------
Some programs are not 100% compatible with ANARKEY. Known
incompatibilities are documented here.
-- SIDEKICK
Old versions of Borland's SIDEKICK will not correctly execute lines
containing multiple commands. After executing the first command on
the line, SIDEKEY will pause before allowing subsequent commands to
run. Pressing any key will cause the remaining commands to execute.
To solve this problem, upgrade to a newer version of SIDEKICK.
-- TOPS
The TOPS local area network alters some of the keystroke codes
received as input from the keyboard. This results in problems when
reassigning keystrokes using ANARKED, the ANARKEY Keystroke Editor.
This problem may be gotten around by restricting key assignments to
only those keystrokes not altered by TOPS. Finding those keys that
are altered is a try-and-see operation (i.e. "try" the keystroke and
"see" if ANARKED handles it correctly).
Future Directions
-----------------
ANARKEY is a powerful and extremely useful program in its current state.
However, I believe that everything can be improved upon and ANARKEY is no
exception. I foresee the future direction of ANARKEY to be primarily
user-driven. For this to be possible, I need your comments and suggestions.
After you've used the program for a while, please take a few minutes to
let me know what you think. I welcome and strongly encourage suggestions
concerning additional features you would like to see added to ANARKEY. I am
also very interested in hearing about the current features that you find
most useful and those that you don't use very often, if at all. Also, if
you decide that ANARKEY is not a useful tool, I would like to know what
features you believe it lacks. All comments - the good, the bad and the
ugly - will receive serious consideration and are strongly encouraged.
The Spirit of ANARKEY
---------------------
While walking down a city sidewalk several years ago, I noticed a crowd
of people gathering around the corner about a block ahead of me. Normally,
I try to avoid crowds at all costs, but this one was directly in my path and
seemed peaceful, so I decided to continue ahead and see what the attraction
was.
Arriving closer, music could be heard coming from within the crowd.
There, in its center, stood a street-corner musician, a lone saxophone
player. The musician blew a sweet and gentle song on his horn, a song I had
never heard before, but which I instantly recognized.
As I stood listening to this music, the atmosphere around me seemed to
change. The typical rush of the city street was calmed by each note. Sharp
edges were smoothed. I felt as though I had been transported to a spring
forest, light greens and blues all around. I stood on the edge of a clear,
flat pond where each long, cool note from the saxophone floated on the
glassy surface. The world became relaxed, friendly and a bit melancholy.
Each note was so palpable, I could hold it in my open palm.
External noises entered. The rhythmic breeze of passing cars, the
syncopated percussion of conversation, all joined in to create a sweet, sad
symphony. A blanket had been placed over the area and we all existed
beneath its protective cover. The song floated on and the blanket slowly
descended, enveloping each person, every object.
Eventually, the saxophone sounds ebbed and drifted off, slowly
evaporating. For an elongated second, the crowd basked in the remaining
wisps of sound. Then polite applause.
Afterward, the musician stood beside his open music case, graciously
accepting the offerings of the appreciative crowd. I remember thinking,
"What a wonderful way to live. Making your way in the world playing such
sweet music. That's the way I want to spend my life." I began saxophone
lessons shortly afterward.
Unfortunately, talent does not always come in the same amount as desire.
Sustained attempts to woo the elusive songbird proved fruitless. The tears
that would well up in my listener's eyes were not the product of a song's
passionate beauty, but rather of its painful rendition and total
destruction. The local dogs would howl in protest whenever I blew. In
rapid succession, half the homes in my neighborhood went up for sale. The
signs eventually became too numerous to ignore. The frequency of my
practice sessions declined in reverse proportion to my realization that I
was a musical wretch.
As a result, I began to spend more time in front of a computer writing
programs, a different kind of song, and an area in which I displayed at
least a modicum of ability. With passing time, the dream of playing sweet
music on a street corner faded. But I never forgot that street musician.
And so, it is in the spirit of a street-corner musician that I dedicate
ANARKEY. I call software created in this spirit "Frustrated-Musicianware."
I hope you find ANARKEY to be as sweet a song as I wish I could play on a
saxophone. If so, won't you please take the time to register it?
Like a street-corner musician, I stand beside my open computer case,
graciously accepting your appreciative gestures.
Please send your registration form, suggestions and comments to:
Steven Calwas
Moderne Software
P.O. Box 3638
Santa Clara, CA 95055-3638
_______
____|__ | (tm)
--| | |-------------------
| ____|__ | Association of
| | |_| Shareware
|__| o | Professionals
-----| | |---------------------
|___|___| MEMBER